// vant省份
import { areaList } from '@vant/area-data'
const options = []
const { province_list, county_list, city_list } = areaList
for (let pro in province_list) {
  const proObj = {
    label: province_list[pro],
    value: province_list[pro],
    children: [],
  }
  for (let city in city_list) {
    if (city.indexOf(pro.slice(0, 2)) === 0) {
      const cityObj = {
        label: city_list[city],
        value: city_list[city],
        children: [],
      }
      for (let county in county_list) {
        if (county.indexOf(city.slice(0, 4)) === 0) {
          const countyObj = {
            label: county_list[county],
            value: county_list[county],
          }
          cityObj.children.push(countyObj)
        } else {
          continue
        }
      }
      proObj.children.push(cityObj)
    } else {
      continue
    }
  }
  options.push(proObj)
}
export default options
